
#ifndef DOWNLOADBETA_H_
#define DOWNLOADBETA_H_

#include <iostream>
#include <stdio.h>
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>

using namespace std; //temporario

// Referencia para CURL:  http://curl.haxx.se/libcurl/c/

class DownloadBeta {
public:
	DownloadBeta(){  curl = curl_easy_init();  }
	~DownloadBeta(){ curl_easy_cleanup(curl); }
	void setURL(string _url){ site_url = _url; }
	string getHeader(void);
	void cleanBuffer(){ data_site = ""; header_site = ""; }
	string getRobot(void);
	string getPage(void);
private:
	static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data);
	static size_t headerCallback(void *ptr, size_t size, size_t nmemb, void *userp);
	int curl_config(void);
	struct data { char trace_ascii; /* 1 or 0 */ };
	string data_site;
	string header_site;
	string site_url;
	CURL *curl;
	int res_code;
};


#endif /*DOWNLOADBETA_H_*/
